package com.test.work.shengang;

import cn.hutool.crypto.SecureUtil;

import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.Locale;

/**
 * @Classname ShengangDecoder
 * @Description TODO
 * @Date 2025/2/7 17:25
 * @Created by rgs
 */
public class GetSign {

    public static void main(String[] args) {

        String appId = "722604506428346369";
        String appSecret = "AAFC0899AF2D4BFAA0829E94BDA97D52";

        getSign(appId,appSecret);
    }






    public static String getSign(String appId,String appSecret){
        Long timestamp = System.currentTimeMillis();
        String appIdBaer = new String(Base64.getEncoder().encode(appId.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8);

        String signStr = appIdBaer + appSecret + timestamp;

        String sign = SecureUtil.md5(signStr).toUpperCase(Locale.ROOT);

        System.out.println("appIdBaer:"+appIdBaer);
        System.out.println("timestamp:"+timestamp);
        System.out.println("sign:"+sign);

        return sign;

    }
}
